import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import LoginView from './views/auth/LoginView'
import HomeLayout from 'src/layouts/HomeLayout'
import NotFoundView from './views/error/NotFoundView'
import { ThemeContext, themes } from './components/ThemeContext'


export default class App extends React.Component {
  constructor(props) {
    super(props)

    this.state = {
      theme: themes.default
    }
  }

  render() {
    return (
      <ThemeContext.Provider value={this.state.theme}>
        <Router>
          <Switch>
            <Route exact path="/">
              <LoginView />
            </Route>
            <Route path="/login">
              <LoginView />
            </Route>
            <Route path="/home">
              <HomeLayout />
            </Route>
            <Route path="/404" component={NotFoundView}></Route>
          </Switch>
        </Router>
      </ThemeContext.Provider>
    )
  }
}